package com.cqhfan.pojo.im.vo;

import com.cqhfan.core.constans.DateConstants;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author 眭传洪
 * @create 2025-08-17 0:47
 */
@Data
public class ChatListVO {

    // 聊天项id
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    // 接收方id
    @JsonSerialize(using = ToStringSerializer.class)
    private Long receiverId;

    // 群id
    @JsonSerialize(using = ToStringSerializer.class)
    private Long groupId;

    // 群名称
    private String groupName;

    // 类型 1单聊 2群聊
    private Integer type;

    // 头像
    private String avatar;

    // 未读消息数量
    private Integer unReaderMessageNums;

    // 群聊消息最后一个发消息的昵称
    private String lastMessageNickName;

    // 最后一条消息内容
    private String lastMessageContent;

    // 最后一条消息的时间
    @JsonFormat(pattern = DateConstants.DATE_TIME_FORMAT)
    private LocalDateTime lastMessageTime;

}
